#include <iostream>
#include "../../public/_ftp.h"
Cftp ftp;
int main()
{
    //C++11的知识点
    auto host = "192.168.9.242";
    auto userame = "test";
    auto passwd = "test";
    if (ftp.login(host, userame, passwd))
    {
        std::cout << "登录成功" << std::endl;
    }
    else
    {
        std::cout << "登录失败" << std::endl;
    }
    if (ftp.mtime("/wanyingxing/project/idc1/ftpshow/output/ftpshow"))
    {
        std::cout << "读取文件时间成功" << std::endl;
        std::cout << ftp.m_mtime << std::endl;
    }
    else
    {
        std::cout << "读取文件时间失败" << std::endl;
    }
    if (ftp.size("/wanyingxing/project/idc1/ftpshow/output/ftpshow"))
    {
        std::cout << "读取文件大小成功" << std::endl;
        std::cout << ftp.m_size << std::endl;
    }
    else
    {
        std::cout << "读取文件大小失败" << std::endl;
    }
    if(ftp.chdir("/wanyingxing/project/idc1/ftpshow/output"))
    {
        std::cout << "修改路径成功" << std::endl;
    }
    else
    {
        std::cout << "修改路径失败" << std::endl;
    }
    if(ftp.nlist(".","/wanyingxing/project/idc1/ftpshow/output/testfile"))
    {
        std::cout << "读取文件成功" << std::endl;
    }
    else
    {
        std::cout << "读取文件失败" << std::endl;
    }
    ftp.logout();
    return 0;
}